#include "leos_timer.h"
#include "leos_thread.h"

static le_tick_t le_tick = 0;

le_tick_t le_tick_get(void)
{
    return le_tick;
}

void le_tick_increase(void)
{
    le_thread_t thread = le_current_thread;

    le_tick++;

    thread->remaining_tick--;
    if (thread->remaining_tick <= 0) {
        thread->remaining_tick = thread->init_tick;

        le_thread_yield();
    }

    le_timer_check(le_tick);
}


